import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

final myTitleProvider = Provider<String>((ref) {
  return "titleFromRiverPod";
});

class LearningRiverPod extends StatefulWidget {
  const LearningRiverPod({super.key});

  @override
  State<LearningRiverPod> createState() => _LearningRiverPodState();
}

class _LearningRiverPodState extends State<LearningRiverPod> {
  @override
  Widget build(BuildContext context) {
    final container = ProviderContainer();
    final title = container.read(myTitleProvider);
    return ProviderScope(
        child: Center(
      child: Text(title),
    ));
  }
}
